/**
 * Created by lihui on 2017/7/24.
 */


   const host = 'https://mb.qsbrokers.com'
    // const host = 'http://192.168.3.2:5555'

// 需要做token认证的路由
const routeIntercept = [ '/laboratory', '/subscribe', '/subscribe/', '/riskratings', '/open2', '/safe', '/income','/signal']

import helpDoc from './help.config'

const version = '1.3.43'

const footerMenu = [
  {
    title: '首页',
    icon: '#icon-shouyeweixuanzhong1',
    iconActive: '#icon-shouye2',
    href: '/index',
    isShow: true
  },
  {
    title: '收益',
    icon: '#icon-shouyidefuben',
    iconActive: '#icon-shouyixuanzhong1',
    href: '/income',
    isShow: false
  },
  {
    title: '交易',
    icon: '#icon-jiaoyi',
    iconActive: '#icon-jiaoyixuanzhongicon',
    href: '/qstrategy',
    isShow: false
  },
  {
    title: '实验',
    icon: '#icon-rendashiyanshix1',
    iconActive: '#icon-shiyanshixuanzhong1',
    href: '/laboratory',
    isShow: false
  },
  {
    title: '我的',
    icon: '#icon-wodex1',
    iconActive: '#icon-wodexuanzhong1',
    href: '/my',
    isShow: false
  }
]

const incomeMenu = [
  {
    title: '收益分析',
    href: '/income/analysis',
    isActive: false
  },
  {
    title: '策略监控',
    href: '/income/monitor',
    isActive: false
  },
  {
    title: '账户详情',
    href: '/income/account',
    isActive: false
  }
]

// unit min
let offlineCache = 60 * 24 * 3
const cacheTime = {
  offlineCache: offlineCache,
  onlineCache: 1
}

const timeout = 10000

const pullDownConfig = {
  content: '',
  height: 30,
  autoRefresh: false,
  downContent: '',
  upContent: '',
  loadingContent: '',
  clsPrefix: 'xs-plugin-pulldown-'
}


let oWidth = document.body.offsetWidth
// 国家坐标
const countryPoint = [
  {
    country: 'china',
    point: {
      x: oWidth * 0.75,
      y: 45
    }
  },
  {
    country: 'usa',
    point: {
      x: oWidth * 0.16,
      y: 55
    }
  },
  {
    country: 'japan',
    point: {
      x: oWidth * 0.83,
      y: 55
    }
  },
  {
    country: 'hongkong',
    point: {
      x: oWidth * 0.76,
      y: 75
    }
  },
  {
    country: 'germany',
    point: {
      x: oWidth * 0.50,
      y: 40
    }
  },
  {
    country: 'singapore',
    point: {
      x: oWidth * 0.75,
      y: 97
    }
  },
  {
    country: 'uk',
    point: {
      x: oWidth * 0.46,
      y: 35
    }
  },
  {
    country: 'france',
    point: {
      x: oWidth * 0.45,
      y: 45
    }
  },
  {
    country: 'it',
    point: {
      x: oWidth * 0.65,
      y: 66
    }
  }
]

//appinbrowser 插件配置

const AppInBrowserOptions = {
  toolbar: {
    height: 61
  },
  title: {
    staticText: '帮助中心',
    showPageTitle: true
  },
  closeButton: {
    image: 'back',
    imagePressed: 'back_pressed',
    align: 'left',
    event: 'backPressed'
  }
}

// 实验室


const regexpValidate = {
  special_character: {
    title: '不得包含特殊字符',
    reg: /[\~\@\#\$\%\^\&\*\!\(\)\-\=\_\+\\\?\/\.\>\,\<\/\，\。\‘\’\；\：\·\！\ ]+/g
  }
}

const particlesJS = {
  "particles": {
    "number": {
      "value": 20,
      "density": {
        "enable": true,
        "value_area": 800
      }
    },
    "color": {
      "value": "#ffffff"
    },
    "shape": {
      "type": "circle",
      "stroke": {
        "width": 0,
        "color": "#000000"
      },
      "polygon": {
        "nb_sides": 5
      },
      "image": {
        "src": "img/github.svg",
        "width": 100,
        "height": 100
      }
    },
    "opacity": {
      "value": 0.1,
      "random": false,
      "anim": {
        "enable": false,
        "speed": 1,
        "opacity_min": 0.1,
        "sync": false
      }
    },
    "size": {
      "value": 10,
      "random": false,
      "anim": {
        "enable": false,
        "speed": 80,
        "size_min": 0.1,
        "sync": false
      }
    },
    "line_linked": {
      "enable": true,
      "distance": 300,
      "color": "#ffffff",
      "opacity": 0.1,
      "width": 2
    },
    "move": {
      "enable": true,
      "speed": 1,
      "direction": "none",
      "random": false,
      "straight": false,
      "out_mode": "bounce",
      "bounce": true,
      "attract": {
        "enable": false,
        "rotateX": 600,
        "rotateY": 1200
      }
    }
  },
  "interactivity": {
    "detect_on": "canvas",
    "events": {
      "onclick": {
        "enable": true,
        "mode": "push"
      },
      "resize": true
    },
    "modes": {
      "grab": {
        "distance": 30,
        "line_linked": {
          "opacity": 0.1
        }
      },
      "bubble": {
        "distance": 800,
        "size": 80,
        "duration": 2,
        "opacity": 0.8,
        "speed": 3
      },
      "repulse": {
        "distance": 400,
        "duration": 0.4
      },
      "push": {
        "particles_nb": 1
      },
      "remove": {
        "particles_nb": 2
      }
    }
  },
  "retina_detect": true
}

export default {
  version,
  regexpValidate,
  host,
  routeIntercept,
  footerMenu,
  pullDownConfig,
  AppInBrowserOptions,
  incomeMenu,
  cacheTime,
  timeout,
  particlesJS,
  countryPoint,
  helpDoc
}
